home *** CD-ROM | disk | FTP | other *** search
- !
- ! Default Guard's script
- !
- ! (c) DC Software, 1992
- !
- ! Pending Enhancements
- !
- ! - I need to create a voice file (.VFL) with voices for this script.
- ! Look at the 'voice()' entries to see what voices it would play if
- ! they were available. These voices could even be placed in the
- ! system's voice file (DCSOUNDS.VFL) in which case the voice command
- ! should read 'voice( xxxx, 1000 )'.
- !
-
- !------------------------------------------------------------------------!
- :@TALK ! Talk to the character !
- !------------------------------------------------------------------------!
-
- if npc.v1 = 1 then
- writeln( "Hello again. How may I help you?" );
- GOTO CHAT; ! Once a password is given, just talk !
- endif;
-
- if npc.v1 = 2 then
- writeln( "Can't you see I'm off duty? Get lost.." );
- GOTO CHAT1;
- endif;
-
- if npc.v0 = 0 then
- writeln( "Halt! Identify yourself!" );
- voice( "Halt1" );
- else
- writeln( "I told you to get lost! What are you doing back here?" );
- voice( "Halt2" );
- endif;
-
- npc.v0 = 1; ! We've been here !
- L0 = 0; ! Count number of bribe attempts !
- L1 = 0; ! Count number of password attempts !
-
- :LOOP
- L3 = select( "Leave","Fight Guard","Give Money","Give Password","Talk" );
- ON L3 GOTO XLEAVE, XFIGHT, BRIBE, PSWRD, TRYCHAT;
-
- :XLEAVE
- writeln( "And don't come back!" );
- STOP;
-
- :TRYCHAT
- writeln( "No unauthorized person is allowed in this area.." );
- writeln( "Please leave." );
- goto LOOP;
-
- !
- ! Fight with the guard..
- !
- :XFIGHT
- writeln( "You asked for it!" );
- voice( "Fight" );
- npc.type = HOSTILE;
- FIGHT;
-
- !
- ! Bribe the guard..
- !
- :BRIBE
- if npc.value = 0 GOTO NOBRIBE; ! Can't bribe this guy.. !
-
- writeln( "You try to bribe the guard.." );
- L4 = getnum("How much do you give?") * 10; ! Convert GOLD to silver !
-
- if L4 < npc.value then
- writeln( "It would take a LOT more than ", $L4, " gold pieces.." );
- voice( "More" );
- goto LOOP;
- endif;
-
- if L4 > group.gold then
- writeln( "You don't have enough gold." );
- voice( "Broke" );
- goto LOOP;
- endif;
-
- writeln( "Now that I think about it, it's time for my break.." );
- voice( "Bribe" );
- dec( group.gold, L4 );
- npc.v1 = 2;
- STOP;
-
- :NOBRIBE
- if L0 > 0 GOTO XFIGHT;
- writeln( "Leave now, before I get really mad.." );
- voice( "NoBribe" );
- inc( L0 );
- goto LOOP;
-
- !
- ! Give the password
- !
- :PSWRD
-
- writeln( "What is the password?" );
- L3 = getstr(); ! The Password !
- if s4 for 8 = s0 then
- writeln( "Thank you. You are now authorized to pass." );
- voice( "Pass" );
- npc.v1 = 1; ! Disactivates guard feature !
- STOP;
- endif;
-
- ON L1 GOTO PSWRD1,PSWRD2,PSWRD3;
- writeln( "I warned you!" );
- voice( "Fight" );
- FIGHT;
-
- :PSWRD1
- writeln( "You'd better leave now.." );
- voice( "NoPass" );
- inc(L1);
- GOTO LOOP;
-
- :PSWRD2
- writeln( "Trying to guess the password is a bad idea.." );
- voice( "NoPass" );
- inc(L1);
- GOTO LOOP;
-
- :PSWRD3
- writeln( "This was your last chance. Leave now!" );
- voice( "NoPass" );
- inc(L1);
- GOTO LOOP;
-
- !
- ! Handle conversations..
- !
- :CHAT
- writeln( "How may I help you?. Please make it brief, I'm on duty." );
-
- :CHAT1
- L3 = getstr("Name","Password","Job","Bye");
- if L3 = -1 then
- writeln( "Ok." );
- STOP;
- endif;
-
- ! First, see if the keyword typed is in the character's text block !
- if dotext( S0 ) then
- if L3 = 3 then
- STOP;
- endif;
- goto CHAT1;
- endif;
-
- ! It didn't, so try the predefined ones..
- on L3 goto CNAME, CPASS, CJOB, CSTOP;
-
- ! Nope, try a 'DEFAULT' line
- if not dotext( "DEFAULT" ) then
- writeln( "I don't know anything about that!" );
- endif;
- goto CHAT1;
-
- :CNAME
- writeln( "My name is ", NPC.name, "." );
- GOTO CHAT1;
-
- :CPASS
- if npc.v1 = 2 then
- writeln( "Can't you see I'm busy?" );
- else
- writeln( "You only have to give it once." );
- endif;
- GOTO CHAT1;
-
- :CJOB
- writeln( "I am a guard!" );
- GOTO CHAT1;
-
- :CSTOP
- writeln( "You're welcome.." );
- STOP;
-
- ! Feel free to expand on this list.. !
-
-